{% extends "base.html" %}

{% block title %}Editing Eve Operation: {{op.name}}{% endblock %}
{% block heading %}Editing Eve Operation: {{op.name}}{% endblock %}

{% block content %}

		<form action='/submitop' method='post' id='mainform' name='mainform'>
		<input type='hidden' name='key' value='{{op.key}}' />
		<input type='hidden' name='isk' value='{{op.isk}}' />
		<table>
			<tr>
				<td>Op name:</td>
				<td>
					<input type='text' name='name' value='{{op.name}}' /></td>
			</tr>
			<tr>
				<td>Op type:</td>
				<td>
					<select name='op_type'>
						<option {% ifequal op.op_type 'PvE' %}selected='selected' {% endifequal %}>PvE</option>
						<option {% ifequal op.op_type 'PvP' %}selected='selected' {% endifequal %}>PvP</option>
						<option {% ifequal op.op_type 'Mining' %}selected='selected' {% endifequal %}>Mining</option>
					</select> 
				</td>
			</tr>
			<tr>
				<td>Date:</td>
				<td>{{op.op_date|date:"j F Y"}}</td>
			</tr>			
			<tr>
				<td>Site type:</td>
				<td>
					<select name='site_type'>
						{% for site in site_names %}
							<option {% ifequal site op.site_type %}selected='selected' {% endifequal %}>{{site}}</option>
						{% endfor %}
					</select> 
				</td>
			</tr>	
			<tr>
				<td>Site count:</td>
				<td><input type='text' name='site_count' value='{{op.site_count}}' size='3' /></td>
			</tr>	
			<tr>
				<td>FC:</td>
				<td>
					<input type='text' name='fc' value='{{op.fc}}' />
				</td>
			</tr>
			<tr>
				<td>Locked:</td>
				<td>
					<input type='checkbox' name='locked' value='locked'
					{% if op.locked %}
						checked
					{% endif %}
					/>					
				</td>
			</tr>
			<tr>
				<td>Pilots:</td>
				<td>{{op.pilots|length}}</td>
			</tr>
			{% for pilot in op.pilots %}
				<tr>
				<td>&nbsp;</td>
				<td>
					{{ pilot }}
					{% ifequal pilot op.fc %}
						(FC)
					{% endifequal %}
				</td>
				</td>
			{% endfor %}
			<tr>
				<td>&nbsp;</td>
				<td><input type='submit' value='Save' /></td>
			</tr>	
		</table>
		</form>

		<script type="text/javascript">
			document.mainform.name.focus();
			document.mainform.name.select();
		</script>
{% endblock %}
